<?php

/***************************************************************************
 *   Copyright (C) 2008 by Julian Cromarty and Stuart Duff (BPX-Dev)       *
 *   julian.cromarty@gmail.com or stu@broken-paradox.com                   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

/* 
 * Add any additional includes here if you create more
 * elements to be integrated into the main template.
 */ 
include('db.php');
include('session.php');
include('includes/layout.php');
include('viewPosts.php');

$session = new Session();

layout::header();
layout::beginMain();

$dbcon = $_SESSION['db']->getInstance();

$getPosts = new viewPosts($dbcon);

$numPosts = (int)$getPosts->getNumPosts();
$startNum = 1;	//First post
$pPP = 10;	//Posts-per-page
for ($i=0; $i < $numPosts; $i++)	{
	$posts = $getPosts->getPosts($startNum, $pPP);
	layout::post($posts[$i]);
}
//TODO: Implement a way of looking at the next set of posts

layout::endMain();
layout::nav();
layout::footer();

$getPosts = null;
$dbcon = null;
?>



<!-- Spacer div -->
<div><br/><br/></div>

</body>

</html> 
